YUI().use('node', function (Y) {
    // A function that pops up a "Hello World" alert:
    var helloWorld = function(e) {
        alert("Hello World!");
    }

    // subscribe the helloWorld function as an event handler for the click
    // event on the container div:
    var node = Y.one("#container");

    node.on("click", helloWorld);

    // A function that pops up an alert and prevents the default behavior of
    // the event for which it is a handler:
    var interceptLink = function(e) {
        e.preventDefault();
        alert("You clicked on the second YUI link.  Because *preventDefault* was called, this link will not navigate away from the page.");
    }

    // subscribe our interceptLink function as a click handler for the second
    // anchor element:
    Y.one('#header').on("click", interceptLink);
});